﻿namespace Chain.Common
{
    using System;

    public class ValCodeModel
    {
        private string _code;
        private DateTime _createdate;
        private double _failure = 180.0;

        public bool CodeFailure
        {
            get
            {
                TimeSpan span = (TimeSpan) (DateTime.Now - this._createdate);
                return (span.TotalSeconds > this._failure);
            }
        }

        public DateTime CreateDate
        {
            get
            {
                return this._createdate;
            }
            set
            {
                this._createdate = value;
            }
        }

        public double Failure
        {
            get
            {
                return this._failure;
            }
            set
            {
                this._failure = value;
            }
        }

        public string valCode
        {
            get
            {
                return this._code;
            }
            set
            {
                this._code = value;
            }
        }
    }
}

